package com.sc.nft.admin.controller;





import com.baomidou.mybatisplus.core.metadata.IPage;
import com.sc.nft.annotation.SysMemberLogin;
import com.sc.nft.dto.IdRequest;
import com.sc.nft.entity.SaasTask;
import com.sc.nft.entity.dto.SaasTaskBasicsDTO;
import com.sc.nft.entity.dto.SaasTaskStageConfigurationListVO;
import com.sc.nft.entity.dto.SaasTaskStarAdminDTO;
import com.sc.nft.entity.vo.SaasTaskBasicsVO;
import com.sc.nft.entity.vo.SaasTaskStageConfigurationTaskListVO;
import com.sc.nft.entity.vo.SaasTaskVO;
import com.sc.nft.service.SaasTaskStageConditionsService;
import com.sc.nft.sup.PageResult;
import com.sc.nft.sup.Result;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.validation.Valid;
import java.util.List;

/**
 * 任务阶段达成条件表(SaasTaskStageConditions)表控制层
 *
 * @author 王伟成
 * @since 2024-04-13 14:14:41
 */

@Slf4j
@RequiredArgsConstructor
@RestController
@RequestMapping("/admin/saasTaskStageConditions")
@Api(tags = "任务阶段达成条件配置")
public class SaasTaskStageConditionsController {
    /**
     * 服务对象
     */
    private final SaasTaskStageConditionsService saasTaskStageConditionsService;


    @PostMapping(value = "stageConfigurationList", produces = MediaType.APPLICATION_JSON_VALUE)
    @ApiOperation(value = "根据任务获取阶段配置列表", httpMethod = "POST", produces = MediaType.APPLICATION_JSON_VALUE)
    @SysMemberLogin
    public Result<List<SaasTaskStageConfigurationListVO>> stageConfigurationList(@Valid @RequestBody IdRequest idRequest) {
        return Result.success(saasTaskStageConditionsService.stageConfigurationList(idRequest.getId()));
    }

    @PostMapping(value = "stageConfigurationTaskList", produces = MediaType.APPLICATION_JSON_VALUE)
    @ApiOperation(value = "根据任务获取阶段配置列表(包含下面的奖励集合)", httpMethod = "POST", produces = MediaType.APPLICATION_JSON_VALUE)
    @SysMemberLogin
    public Result<List<SaasTaskStageConfigurationTaskListVO>> stageConfigurationTaskList(@Valid @RequestBody IdRequest idRequest) {
        return Result.success(saasTaskStageConditionsService.stageConfigurationTaskList(idRequest.getId()));
    }
}
